/** simple buffer manager that distributes the buffers equally among
all the join operators
**/

package qp.optimizer;


public class BufferManager{

  static int numBuffer;
    static int numJoin;

    static int buffPerJoin;
    static int bufferForSort;//add by wang suyun 2009.11.05


    public BufferManager(int numBuffer, int numJoin){
	this.numBuffer = numBuffer;
	this.numJoin = numJoin;
	buffPerJoin = numBuffer/numJoin;
	bufferForSort=buffPerJoin;// add by wang suyun 2009.11.05
    }

    public static int getBuffersPerJoin(){
	return buffPerJoin;
    }
    
    public static int getBufferForSort() {
    	return bufferForSort;
    }

}
